package fr.norsys.mapper.console.test;

import java.util.Comparator;

import fr.norsys.mapper.console.model.Resource;

public class ResourceNameComparator implements Comparator {
public int compare(Object o1, Object o2) {
	if(o1 != null && o2 != null && o1 instanceof Resource && o2 instanceof Resource) {
		Resource r1 = (Resource) o1;
		Resource r2 = (Resource) o2;
		if(r1.getName()!=null && r2.getName()!=null)
			return r1.getName().compareTo(r2.getName());
	}
	return 0; 
}
}
